<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css">
    <script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>
    <script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
    <meta charset="UTF-8">
    <title>Title</title>
<!--    <script th:inline="javascript">-->
<!--        var userInfo= [[${loginUser}]];-->
<!--        console.log(userInfo);-->
<!--        if(userInfo=="登陆失败"){-->
<!--            alert("用户名或密码错误")-->
<!--            -->
<!--        }-->
<!--    </script>-->
    <footer th:fragment="header">
        <div class="col-md-12 column">
            <h3 class="text-center">
                NewsDemo系统框架设计
                <button type="button" style="float: right;margin-right: 100px;border: 0;background-color: white "
                        data-toggle="modal" data-target="#myModal">
                    <span th:if="${session.loginUser}==null" >登陆</span>
                </button>
                <div style="float: right;margin-right: 100px;border: 0;background-color: white ">
                    <span id="user" th:if="${session.loginUser}" th:text="${session.loginUser.username}" ></span>
                    <a th:if="${session.loginUser}" th:href="@{/logout/}">退出登陆</a>
                </div>
                <div style="margin-top: 200px" class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
                    <div class="modal-dialog">
                        <div class="modal-content">
                            <form  method="post" th:action="@{/checklogin}"     role="form">
                                <div class="modal-header">
                                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                                        &times;
                                    </button>
                                    <h4 class="modal-title" id="myModalLabel">
                                        登陆
                                    </h4>
                                </div>
                                <div   class="row clearfix">
                                    <div  class="col-md-8 column" style="margin-top: 30px;margin-bottom: 30px;margin-left: 20%;">
                                        <div class="input-group" >
                                            <span class="input-group-addon">账号</span>
                                            <input th:name="username" type="text" class="form-control"  style="text-align: center" >
                                        </div>
                                    </div>
                                    <div  class="col-md-8 column" style="margin-top: 30px;margin-bottom: 30px;margin-left: 20%;">
                                        <div class="input-group" >
                                            <span class="input-group-addon">密码</span>
                                            <input th:name="password" type="text" class="form-control"  style="text-align: center" >
                                        </div>
                                    </div>
                                </div>
                                <div class="modal-footer">
                                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭
                                    </button>
                                    <button  type="submit" class="btn btn-primary">
                                        提交更改
                                    </button>
                                </div>
                            </form>
                        </div><!-- /.modal-content -->
                    </div><!-- /.modal -->
                </div>
            </h3>
        </div>
    </footer>

</head>
<body>

</body>
</html>